import { Children, lazy } from "react";
import {createBrowserRouter} from 'react-router-dom'
import { Navigate } from "react-router-dom";

import Zhu from '../page/Zhu/Index'
import Login from '../page/Login/Index'
import Home from '../page/Home/Index'
import List from '../page/List/Index'
import Order from '../page/Order/Index'
import Index from "../page/Index/Index";
import Xq from '../page/Xq/Index'
import Yichang from '../page/Yichang/Index'
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
    TeamOutlined,
    UserOutlined,
  } from '@ant-design/icons';

export const menu_router=[
    {
        path:"/zhu/home",
        title:"首页",
        element:<Home></Home>,
        icon:<DesktopOutlined></DesktopOutlined>
    },
    {
        path:"/zhu/index",
        title:"Dashboard",
        element:<Index></Index>,
        icon:<FileOutlined></FileOutlined>
    },
    {
        path:"/zhu/list",
        title:"系统管理",
        element:<List></List>,
        icon:<PieChartOutlined></PieChartOutlined>,
        children:[
            {
                path:"/zhu/list/order",
                title:"用户管理",
                element:<Order></Order>,
                icon:<FileOutlined></FileOutlined>
            }
        ]
    },
    {
        path:"/zhu/xq",
        title:"详情",
        element:<Xq></Xq>,
        icon:<UserOutlined></UserOutlined>
    },
    {
        path:"/zhu/yichang",
        title:"异常页面",
        element:<Yichang></Yichang>,
        icon:<TeamOutlined></TeamOutlined>
    },
]

const routes=createBrowserRouter([
    {
        path:"/",
        element:<Navigate to={'/zhu'}></Navigate>
    },
    {
        path:"/zhu",
        element:<Zhu></Zhu>,
        children:menu_router
    },
    {
        path:"/login",
        element:<Login></Login>
    }
])

export default routes